8.1
HIGH CVSS 4.0
CVE-2026-9277
shell-quote `quote()` does not validate object-token shapes, allowing command injection via line terminators in `.op`
Description

shell-quote's `quote()` function did not validate object-token inputs against the operator model used by `parse()`. The `.op` field was backslash-escaped character by character using `/(.)/g`, which in JavaScript does not match line terminators (\n, \r, U+2028, U+2029). A line terminator in `.op` therefore passed through unescaped into the output; POSIX shells treat a literal newline as a command separator, so any content after it would execute as a second command. The vulnerable code path is reachable in two ways: (1) direct construction of `{ op: '...\n...' }` from external input, and (2) via `parse(cmd, envFn)` when `envFn` returns object tokens whose `.op` is attacker-influenced. Both are documented API surface. Fixed by replacing the per-character escape with strict shape validation: `.op` must match the parser's control-operator allowlist; `{ op: 'glob', pattern }` validates `pattern` and forbids line terminators; `{ comment }` validates `comment` and forbids line terminators; any other object shape throws `TypeError`.

INFO

Published Date :

May 22, 2026, 1:22 p.m.

Last Modified :

May 22, 2026, 1:22 p.m.

Remotely Exploit :

Yes !

Source :

harborist
Affected Products

The following products are affected by CVE-2026-9277 vulnerability. Even if cvefeed.io is aware of the exact versions of the products that are affected, the information is not represented in the table below.

No affected product recoded yet

CVSS Scores
The Common Vulnerability Scoring System is a standardized framework for assessing the severity of vulnerabilities in software and systems. We collect and displays CVSS scores from various sources for each CVE.
Score Version Severity Vector Exploitability Score Impact Score Source
CVSS 3.1 HIGH 7ffcee3d-2c14-4c3e-b844-86c6a321a158
CVSS 3.1 HIGH MITRE-CVE
CVSS 4.0 CRITICAL 7ffcee3d-2c14-4c3e-b844-86c6a321a158
Solution
Update shell-quote to validate operator inputs and prevent command injection via newline characters.
  • Update the shell-quote library to the latest version.
  • Validate all inputs to the quote() function.
  • Ensure .op field conforms to allowed operators.
  • Disallow line terminators in sensitive fields.

We scan GitHub repositories to detect new proof-of-concept exploits. Following list is a collection of public exploits and proof-of-concepts, which have been published on GitHub (sorted by the most recently updated).

Results are limited to the first 15 repositories due to potential performance issues.

The following list is the news that have been mention CVE-2026-9277 vulnerability anywhere in the article.

The following table lists the changes that have been made to the CVE-2026-9277 vulnerability over time.

Vulnerability history details can be useful for understanding the evolution of a vulnerability, and for identifying the most recent changes that may impact the vulnerability's severity, exploitability, or other characteristics.

  • CVE Modified by 134c704f-9b21-4f2e-91b3-4a467353bcc0

    May. 22, 2026

    Action Type Old Value New Value
    Added Reference https://github.com/ljharb/shell-quote/security/advisories/GHSA-w7jw-789q-3m8p
  • New CVE Received by 7ffcee3d-2c14-4c3e-b844-86c6a321a158

    May. 22, 2026

    Action Type Old Value New Value
    Added Description shell-quote's `quote()` function did not validate object-token inputs against the operator model used by `parse()`. The `.op` field was backslash-escaped character by character using `/(.)/g`, which in JavaScript does not match line terminators (\n, \r, U+2028, U+2029). A line terminator in `.op` therefore passed through unescaped into the output; POSIX shells treat a literal newline as a command separator, so any content after it would execute as a second command. The vulnerable code path is reachable in two ways: (1) direct construction of `{ op: '...\n...' }` from external input, and (2) via `parse(cmd, envFn)` when `envFn` returns object tokens whose `.op` is attacker-influenced. Both are documented API surface. Fixed by replacing the per-character escape with strict shape validation: `.op` must match the parser's control-operator allowlist; `{ op: 'glob', pattern }` validates `pattern` and forbids line terminators; `{ comment }` validates `comment` and forbids line terminators; any other object shape throws `TypeError`.
    Added CVSS V4.0 AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
    Added CVSS V3.1 AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
    Added CWE CWE-78
    Added CWE CWE-77
    Added Reference https://github.com/ljharb/shell-quote
    Added Reference https://github.com/ljharb/shell-quote/commit/1518179
    Added Reference https://github.com/ljharb/shell-quote/security/advisories/GHSA-w7jw-789q-3m8p
    Added Reference https://www.npmjs.com/package/shell-quote
EPSS is a daily estimate of the probability of exploitation activity being observed over the next 30 days. Following chart shows the EPSS score history of the vulnerability.